class Integer

  # @param maxNumber [Object]
  def primesUpTo(maxNumber)
    primes = Array.new(maxNumber, true)
    primes[0] = false

    primes.each_with_index do |primes, i|
      if primes then
        yield(i+1)
        (2*i+1).step(maxNumber, i+1) do |index| #here we say that we will go up to maxNumber
          primes[index] = false
        end
      end
    end
    puts primes.inspect
    return

  end


end
